
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>OLED驱动移植 · STM32HAL系列教程</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="Atonidas">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-theme-lou/lou.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="LVGL移植显示.html" />
    
    
    <link rel="prev" href="CubeMX配置及主要函数.html" />
    

    </head>
    <body>
         

<div class="book">
  <div class="header-inner">
    <!-- LOGO -->
    <div class="logo"></div>
    <span class="title"></span>

    <!-- Search -->
    
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>


    <!-- Nav -->
    <ul class="header-nav">
      <li>
        <a href="https://Gitee.com/atonidas" target="_blank">Gitee</a>
      </li>
    </ul>
  </div>

  <div class="book-summary">
    <div class="book-summary-title">文档目录</div>
     
    <nav role="navigation">


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../软件环境/">
            
                <a href="../软件环境/">
            
                    
                    软件环境
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../软件环境/VScode的使用.html">
            
                <a href="../软件环境/VScode的使用.html">
            
                    
                    VScode快速入门
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../软件环境/VSCode插件分享.html">
            
                <a href="../软件环境/VSCode插件分享.html">
            
                    
                    VScode插件分享
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../软件环境/CubeMX简介.html">
            
                <a href="../软件环境/CubeMX简介.html">
            
                    
                    CubeMX简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../软件环境/创建一个工程.html">
            
                <a href="../软件环境/创建一个工程.html">
            
                    
                    创建一个工程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="../软件环境/Git版本管理.html">
            
                <a href="../软件环境/Git版本管理.html">
            
                    
                    Git版本管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="../软件环境/创建一个快速开发模板.html">
            
                <a href="../软件环境/创建一个快速开发模板.html">
            
                    
                    创建一个快速开发模板
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../STM32的IO口/">
            
                <a href="../STM32的IO口/">
            
                    
                    STM32的IO口
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../STM32的IO口/点亮一个LED.html">
            
                <a href="../STM32的IO口/点亮一个LED.html">
            
                    
                    点亮一个LED
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../STM32的IO口/使用独立按键.html">
            
                <a href="../STM32的IO口/使用独立按键.html">
            
                    
                    使用独立按键
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../STM32中断/">
            
                <a href="../STM32中断/">
            
                    
                    STM32中断
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../STM32中断/CubeMX外部中断配置.html">
            
                <a href="../STM32中断/CubeMX外部中断配置.html">
            
                    
                    CubeMX外部中断配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../STM32中断/HAL库外部中断程序.html">
            
                <a href="../STM32中断/HAL库外部中断程序.html">
            
                    
                    HAL库外部中断程序
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../STM32定时器/">
            
                <a href="../STM32定时器/">
            
                    
                    STM32定时器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../STM32定时器/定时器简单中断程序.html">
            
                <a href="../STM32定时器/定时器简单中断程序.html">
            
                    
                    定时器简单中断程序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../STM32定时器/硬件PWM输出.html">
            
                <a href="../STM32定时器/硬件PWM输出.html">
            
                    
                    硬件PWM输出
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../STM32定时器/DMA输出PWM控制WS2812.html">
            
                <a href="../STM32定时器/DMA输出PWM控制WS2812.html">
            
                    
                    DMA输出PWM控制WS2812
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../STM32串口/">
            
                <a href="../STM32串口/">
            
                    
                    STM32串口
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../STM32串口/串口发送及中断接收.html">
            
                <a href="../STM32串口/串口发送及中断接收.html">
            
                    
                    串口发送及中断接收
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../STM32串口/串口的格式化输出.html">
            
                <a href="../STM32串口/串口的格式化输出.html">
            
                    
                    串口的格式化输出
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../STM32串口/串口DMA传输.html">
            
                <a href="../STM32串口/串口DMA传输.html">
            
                    
                    串口DMA传输
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../STM32串口/简单协议编写.html">
            
                <a href="../STM32串口/简单协议编写.html">
            
                    
                    简单协议编写
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="./">
            
                <a href="./">
            
                    
                    SPI协议
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="CubeMX配置及主要函数.html">
            
                <a href="CubeMX配置及主要函数.html">
            
                    
                    CubeMX配置及主要参数
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.7.2" data-path="OLED驱动移植.html">
            
                <a href="OLED驱动移植.html">
            
                    
                    OLED驱动移植
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="LVGL移植显示.html">
            
                <a href="LVGL移植显示.html">
            
                    
                    LVGL移植显示
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="Flash的使用及文件系统.html">
            
                <a href="Flash的使用及文件系统.html">
            
                    
                    Flash的使用及文件系统
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../ADC的使用/">
            
                <a href="../ADC的使用/">
            
                    
                    ADC的使用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../ADC的使用/CubeMX中ADC配置概览.html">
            
                <a href="../ADC的使用/CubeMX中ADC配置概览.html">
            
                    
                    CubeMX中ADC配置概览
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../ADC的使用/查询阻塞方式.html">
            
                <a href="../ADC的使用/查询阻塞方式.html">
            
                    
                    查询阻塞方式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../ADC的使用/中断方式.html">
            
                <a href="../ADC的使用/中断方式.html">
            
                    
                    中断方式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="../ADC的使用/DMA方式.html">
            
                <a href="../ADC的使用/DMA方式.html">
            
                    
                    DMA方式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.5" data-path="../ADC的使用/应用示例.html">
            
                <a href="../ADC的使用/应用示例.html">
            
                    
                    应用示例
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../其他代码整合搬运/">
            
                <a href="../其他代码整合搬运/">
            
                    
                    其他代码整合搬运
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../其他代码整合搬运/MultiButton.html">
            
                <a href="../其他代码整合搬运/MultiButton.html">
            
                    
                    MultiButton
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../其他代码整合搬运/EasyLogger.html">
            
                <a href="../其他代码整合搬运/EasyLogger.html">
            
                    
                    EasyLogger
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../其他代码整合搬运/letter-shell.html">
            
                <a href="../其他代码整合搬运/letter-shell.html">
            
                    
                    letter-shell
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" data-path="../其他代码整合搬运/EasyFlash.html">
            
                <a href="../其他代码整合搬运/EasyFlash.html">
            
                    
                    EasyFlash
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.5" data-path="../其他代码整合搬运/时间片调度.html">
            
                <a href="../其他代码整合搬运/时间片调度.html">
            
                    
                    时间片调度
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../加入我们/">
            
                <a href="../加入我们/">
            
                    
                    加入我们
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../加入我们/Gitbook环境.html">
            
                <a href="../加入我们/Gitbook环境.html">
            
                    
                    Gitbook环境
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../加入我们/Markdown语法简介.html">
            
                <a href="../加入我们/Markdown语法简介.html">
            
                    
                    Markdown语法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" data-path="../加入我们/编辑器推荐.html">
            
                <a href="../加入我们/编辑器推荐.html">
            
                    
                    编辑器推荐
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.4" data-path="../加入我们/工程文件说明.html">
            
                <a href="../加入我们/工程文件说明.html">
            
                    
                    工程文件说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.5" data-path="../加入我们/提交注意事项.html">
            
                <a href="../加入我们/提交注意事项.html">
            
                    
                    提交注意事项
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>

</nav>
     
  </div>

  <!-- Content nav -->
  <div class="book-anchor">
    <div class="book-anchor-title"></div>

    <div class="book-anchor-body"></div>
  </div>

  <div class="book-body">
    
    <div class="body-inner">
       

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >OLED驱动移植</a>
    </h1>
</div>



      <div class="page-wrapper" tabindex="-1" role="main">
        <div class="page-inner">
          
<div id="book-search-results">
    <div class="search-noresults">
    
          <section class="normal markdown-section">
             <h1 id="oled&#x9A71;&#x52A8;&#x79FB;&#x690D;">OLED&#x9A71;&#x52A8;&#x79FB;&#x690D;</h1>
<blockquote>
<p>&#x79FB;&#x690D;&#x5E93;&#x51FD;&#x6570;&#x7684;OLED&#x9A71;&#x52A8;&#x5230;HAL&#x5E93;&#x4E0B;&#xFF0C;&#x4E86;&#x89E3;&#x4E00;&#x822C;&#x79FB;&#x690D;&#x8FC7;&#x7A0B;</p>
</blockquote>
<h2 id="io&#x53E3;&#x914D;&#x7F6E;">IO&#x53E3;&#x914D;&#x7F6E;</h2>
<p>&#x6839;&#x636E;&#x4E0A;&#x4E00;&#x5C0F;&#x8282;&#x6240;&#x5B66;&#x5185;&#x5BB9;&#xFF0C;&#x6211;&#x4EEC;&#x914D;&#x7F6E;OLED&#x6240;&#x7528;&#x5230;&#x7684;&#x56DB;&#x4E2A;IO&#x53E3;&#xFF0C;&#x5176;&#x4E2D;CS&#x548C;DC&#x5F15;&#x811A;&#x90FD;&#x662F;&#x8F93;&#x51FA;&#x6A21;&#x5F0F;</p>
<ul>
<li><strong>SCK&#xFF1A;</strong> SPI2&#x7684;SCK&#xFF0C;&#x4F7F;&#x7528;PB13&#x5F15;&#x811A;</li>
<li><strong>MOSI:</strong> SPI2&#x7684;MOSI&#xFF0C;&#x4F7F;&#x7528;PB15&#x5F15;&#x811A;</li>
<li><strong>OLED_CS:</strong> OLED&#x7684;&#x7247;&#x9009;&#x5F15;&#x811A;&#xFF0C;&#x4F7F;&#x7528;PB12</li>
<li><strong>OELD_DC:</strong> OLED&#x7684;&#x6307;&#x4EE4;\&#x6570;&#x636E;&#x6807;&#x8BC6;&#x5F15;&#x811A;&#xFF0C;&#x4F7F;&#x7528;PB10</li>
</ul>
<p><img src="assets/OLED&#x5F15;&#x811A;.png" alt="OLED&#x5F15;&#x811A;&#x914D;&#x7F6E;"></p>
<blockquote>
<p><strong>DC:</strong> &#x542B;&#x4E49;Data (or) Command&#xFF0C;&#x901A;&#x8FC7;&#x63A7;&#x5236;&#x8FD9;&#x4E2A;&#x5F15;&#x811A;&#x7684;&#x9AD8;&#x4F4E;&#x7535;&#x5E73;&#xFF0C;&#x6765;&#x544A;&#x8BC9;OLED&#x9A71;&#x52A8;&#x8F93;&#x5165;&#x7684;&#x662F;<strong>&#x6307;&#x4EE4;&#x8FD8;&#x662F;&#x6570;&#x636E;</strong></p>
</blockquote>
<p>&#x4E4B;&#x540E;&#x5982;&#x679C;&#x9700;&#x8981;&#x4E00;&#x4E9B;&#x8C03;&#x8BD5;&#x5916;&#x8BBE;&#xFF0C;&#x53EF;&#x4EE5;&#x81EA;&#x884C;&#x6253;&#x5F00;&#x4E32;&#x53E3;&#x6216;&#x8005;LED&#x4EE5;&#x53CA;&#x6309;&#x952E;&#x7B49;&#x5916;&#x8BBE;&#xFF0C;&#x5B8C;&#x6210;&#x521B;&#x5EFA;&#x76F8;&#x5E94;&#x5DE5;&#x7A0B;</p>
<h2 id="&#x7A0B;&#x5E8F;&#x51C6;&#x5907;">&#x7A0B;&#x5E8F;&#x51C6;&#x5907;</h2>
<p>&#x76EE;&#x524D;&#x5E38;&#x7528;&#x7684;&#x5C4F;&#x5E55;&#x6A21;&#x5757;&#x5927;&#x591A;&#x6765;&#x81EA;&#x4E8E;<a href="https://zjy-display.taobao.com/shop/view_shop.htm?spm=a230r.1.14.19.35b45078qJwVEe&amp;user_number_id=914671862" target="_blank">&#x4E2D;&#x666F;&#x56ED;&#x7535;&#x5B50;</a>&#xFF0C;&#x5F88;&#x591A;&#x5C0F;&#x53F7;&#x5C4F;&#x5E55;&#x6A21;&#x5757;&#x90FD;&#x80FD;&#x5728;&#x8FD9;&#x4E70;&#x5230;&#xFF0C;&#x6839;&#x636E;&#x5C4F;&#x5E55;&#x5927;&#x5C0F;&#x6216;&#x8005;<strong>&#x663E;&#x793A;&#x9A71;&#x52A8;</strong>&#x53EF;&#x4EE5;&#x627E;&#x5230;&#x5F88;&#x591A;&#x53EF;&#x9009;&#x6A21;&#x5757;&#x3002;&#x800C;&#x62FF;&#x5230;&#x4E00;&#x4E2A;&#x65B0;&#x7684;&#x5C4F;&#x5E55;&#x6A21;&#x5757;&#x540E;&#xFF0C;&#x81F3;&#x5C11;&#x627E;&#x5230;&#x8BE5;&#x5C4F;&#x5E55;&#x7684;&#x663E;&#x793A;&#x9A71;&#x52A8;&#xFF0C;&#x7136;&#x540E;&#x53BB;&#x7F51;&#x4E0A;&#x627E;&#x5230;&#x5546;&#x5BB6;&#x63D0;&#x4F9B;&#x7684;&#x793A;&#x4F8B;&#x4EE3;&#x7801;&#x540E;&#x5C31;&#x53EF;&#x4EE5;&#x5F00;&#x59CB;&#x672C;&#x8282;&#x8BFE;&#x7684;&#x5185;&#x5BB9;&#x3002;&#x7ED9;&#x5404;&#x4F4D;&#x63D0;&#x4F9B;&#x7684;1.29&#x5BF8;OLED&#x6A21;&#x5757;&#x662F;ch1115&#x9A71;&#x52A8;&#xFF0C;&#x5546;&#x54C1;&#x9875;&#x53C2;&#x8003;<a href="https://item.taobao.com/item.htm?spm=a1z10.5-c-s.w4002-23284685151.22.7de44543WFF4gd&amp;id=634148945663" target="_blank">&#x6B64;&#x5904;</a></p>
<p>&#x4E0B;&#x8F7D;&#x5356;&#x5BB6;&#x63D0;&#x4F9B;&#x7684;&#x8D44;&#x6599;&#x540E;&#xFF0C;&#x6211;&#x4EEC;&#x627E;&#x5230;&#x7A0B;&#x5E8F;&#x6E90;&#x7801;&#x4E2D;&#x7684;&#x5982;&#x4E0B;&#x8DEF;&#x5F84;&#x6587;&#x4EF6;&#x5939;&#xFF0C;&#x6574;&#x4E2A;&#x590D;&#x5236;&#x5230;&#x521B;&#x5EFA;&#x7684;SPI&#x5DE5;&#x7A0B;&#x4E2D;&#xFF1A;</p>
<p><img src="assets/&#x6DFB;&#x52A0;OLED&#x6E90;&#x7801;.png" alt="&#x6DFB;&#x52A0;OLED&#x6E90;&#x7801;"></p>
<p>&#x4E4B;&#x540E;&#x5728;VS code&#x6253;&#x5F00;&#x5DE5;&#x7A0B;&#xFF0C;&#x6DFB;&#x52A0;&#x76F8;&#x5E94;&#x7684;&#x6587;&#x4EF6;&#x5939;&#x5230;&#x5DE5;&#x7A0B;&#x4E2D;&#xFF1A;</p>
<p><img src="assets/&#x5DE5;&#x7A0B;&#x6DFB;&#x52A0;&#x6587;&#x4EF6;&#x5939;.png" alt="&#x5DE5;&#x7A0B;&#x6DFB;&#x52A0;&#x6587;&#x4EF6;&#x5939;"></p>
<h2 id="&#x5E93;&#x51FD;&#x6570;&#x4EE3;&#x7801;&#x4FEE;&#x6B63;">&#x5E93;&#x51FD;&#x6570;&#x4EE3;&#x7801;&#x4FEE;&#x6B63;</h2>
<h3 id="&#x5934;&#x6587;&#x4EF6;&#x4EE3;&#x7801;&#x66F4;&#x6539;">&#x5934;&#x6587;&#x4EF6;&#x4EE3;&#x7801;&#x66F4;&#x6539;</h3>
<p>&#x5728;<code>main.h</code>&#x4E2D;&#x6DFB;&#x52A0;&#x4EE5;&#x4E0B;&#x5B9A;&#x4E49;&#xFF1A;</p>
<pre><code class="lang-c"><span class="hljs-comment">/* USER CODE BEGIN Private defines */</span>
<span class="hljs-keyword">typedef</span> <span class="hljs-keyword">uint8_t</span> u8;
<span class="hljs-keyword">typedef</span> <span class="hljs-keyword">uint16_t</span> u16;
<span class="hljs-keyword">typedef</span> <span class="hljs-keyword">uint32_t</span> u32;
<span class="hljs-comment">/* USER CODE END Private defines */</span>
</code></pre>
<p>&#x6253;&#x5F00;<code>oled.h</code>&#x4FEE;&#x6B63;&#x4EE5;&#x4E0B;&#x5E93;&#x51FD;&#x6570;&#x7684;&#x4EE3;&#x7801;&#xFF1A;</p>
<p><img src="assets/&#x5E93;&#x51FD;&#x6570;&#x5934;&#x6587;&#x4EF6;&#x4FEE;&#x6B63;.png" alt="&#x5E93;&#x51FD;&#x6570;&#x5934;&#x6587;&#x4EF6;&#x4FEE;&#x6B63;"></p>
<pre><code class="lang-c"><span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-string">&quot;main.h&quot;</span></span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-string">&quot;stdlib.h&quot;</span></span>

<span class="hljs-comment">//-----------------OLED&#x7AEF;&#x53E3;&#x5B9A;&#x4E49;----------------</span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">define</span> OLED_DC_Clr()  HAL_GPIO_WritePin(OLED_DC_GPIO_Port, OLED_DC_Pin, 0)<span class="hljs-comment">//DC</span></span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">define</span> OLED_DC_Set()  HAL_GPIO_WritePin(OLED_DC_GPIO_Port, OLED_DC_Pin, 1)</span>

<span class="hljs-meta">#<span class="hljs-meta-keyword">define</span> OLED_CS_Clr()  HAL_GPIO_WritePin(OLED_CS_GPIO_Port, OLED_CS_Pin, 0)<span class="hljs-comment">//CS</span></span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">define</span> OLED_CS_Set()  HAL_GPIO_WritePin(OLED_CS_GPIO_Port, OLED_CS_Pin, 1)</span>

<span class="hljs-meta">#<span class="hljs-meta-keyword">define</span> OLED_CMD  0    <span class="hljs-comment">//&#x5199;&#x547D;&#x4EE4;</span></span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">define</span> OLED_DATA 1    <span class="hljs-comment">//&#x5199;&#x6570;&#x636E;</span></span>
</code></pre>
<p>&#x5176;&#x4E2D;<code>sys.h</code>&#x662F;&#x5E93;&#x51FD;&#x6570;&#x7684;&#x5934;&#x6587;&#x4EF6;&#xFF0C;&#x8FD9;&#x91CC;&#x6539;&#x4E3A;&#x4F7F;&#x7528;HAL&#x5E93;&#x7684;&#xFF0C;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x5305;&#x542B;<code>main.h</code>&#xFF1B;&#x800C;<strong>SCL&#x3001;SDA&#x4E3A;&#x901A;&#x8BAF;&#x5F15;&#x811A;</strong>&#xFF0C;&#x56E0;&#x4E3A;&#x6211;&#x4EEC;<strong>&#x4F7F;&#x7528;&#x786C;&#x4EF6;&#x63A7;&#x5236;&#x7684;&#x4F20;&#x8F93;&#x534F;&#x8BAE;</strong>&#xFF0C;&#x901A;&#x4FE1;&#x5F15;&#x811A;&#x7684;&#x65F6;&#x949F;&#x548C;&#x6570;&#x636E;&#x7EBF;&#x4F20;&#x8F93;&#x5177;bit&#x4F4D;&#x65F6;&#x7684;&#x7EC6;&#x8282;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x4E0D;&#x7528;&#x5728;&#x610F;&#xFF0C;&#x6240;&#x4EE5;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x5220;&#x9664;&#x8FD9;&#x4E24;&#x884C;&#x5B8F;&#x5B9A;&#x4E49;&#xFF1B;<strong>RES</strong>&#x4E3A;OLED&#x9A71;&#x52A8;&#x7684;&#x590D;&#x4F4D;&#x5F15;&#x811A;&#xFF0C;&#x786C;&#x4EF6;&#x8FDE;&#x63A5;&#x4E0A;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x63A5;&#x4E0A;&#x9AD8;&#x7535;&#x5E73;&#xFF0C;&#x6545;&#x8FD9;&#x91CC;&#x4E5F;&#x53EF;&#x4EE5;&#x5220;&#x9664;&#x3002;</p>
<h3 id="&#x6E90;&#x6587;&#x4EF6;&#x4EE3;&#x7801;&#x66F4;&#x6539;">&#x6E90;&#x6587;&#x4EF6;&#x4EE3;&#x7801;&#x66F4;&#x6539;</h3>
<p>&#x5220;&#x9664;<code>delay.h</code>&#x5934;&#x6587;&#x4EF6;&#x7684;&#x5F15;&#x7528;&#xFF0C;&#x8BE5;&#x6587;&#x4EF6;&#x4E3A;&#x5E93;&#x51FD;&#x6570;&#x65B9;&#x5F0F;&#x4E0B;&#x5B9E;&#x73B0;&#x7684;&#x5EF6;&#x65F6;&#xFF0C;&#x800C;&#x6211;&#x4EEC;&#x662F;&#x4F7F;&#x7528;HAL&#x7684;&#xFF0C;&#x6545;&#x5C06;&#x5176;&#x5220;&#x9664;&#xFF1A;</p>
<p><img src="assets/&#x5220;&#x9664;&#x5E93;&#x51FD;&#x6570;&#x5934;&#x6587;&#x4EF6;.png" alt="&#x5220;&#x9664;&#x5E93;&#x51FD;&#x6570;&#x5934;&#x6587;&#x4EF6;"></p>
<p>&#x627E;&#x5230;&#x4EE5;&#x4E0B;IO&#x521D;&#x59CB;&#x5316;&#x7684;&#x4EE3;&#x7801;&#x6BB5;&#xFF08;&#x90E8;&#x5206;&#x662F;&#x5B9A;&#x4E49;&#x4E86;&#x4E00;&#x4E2A;&#x51FD;&#x6570;&#xFF09;&#xFF0C;&#x5C06;&#x5176;&#x5220;&#x9664;&#xFF1B;CubeMX&#x751F;&#x6210;&#x4EE3;&#x7801;&#x65F6;&#xFF0C;&#x5DF2;&#x7ECF;&#x5305;&#x542B;&#x4E86;IO&#x53E3;&#x7684;&#x76F8;&#x5E94;&#x914D;&#x7F6E;&#xFF0C;&#x4E0D;&#x9700;&#x8981;&#x518D;&#x6B21;&#x914D;&#x7F6E;&#xFF1A;</p>
<p><img src="assets/&#x5220;&#x9664;&#x521D;&#x59CB;&#x5316;&#x4EE3;&#x7801;.png" alt="&#x5220;&#x9664;&#x521D;&#x59CB;&#x5316;&#x4EE3;&#x7801;"></p>
<h2 id="&#x5411;oled&#x53D1;&#x9001;&#x4E00;&#x4E2A;&#x5B57;&#x8282;">&#x5411;OLED&#x53D1;&#x9001;&#x4E00;&#x4E2A;&#x5B57;&#x8282;</h2>
<h3 id="&#x6A21;&#x62DF;&#x65B9;&#x5F0F;&#x65F6;&#x5E8F;&#x89E3;&#x8BFB;">&#x6A21;&#x62DF;&#x65B9;&#x5F0F;&#x65F6;&#x5E8F;&#x89E3;&#x8BFB;</h3>
<p>&#x627E;&#x5230;&#x5982;&#x4E0B;&#x51FD;&#x6570;&#xFF1A;</p>
<p><img src="assets/&#x6A21;&#x62DF;spi&#x65F6;&#x5E8F;.png" alt="&#x6A21;&#x62DF;SPI&#x65F6;&#x5E8F;"></p>
<p>&#x8FD9;&#x4E00;&#x5757;&#x662F;&#x5BF9;&#x63A5;OLED&#x9A71;&#x52A8;&#x65F6;&#x6700;&#x5173;&#x952E;&#x7684;&#x4E00;&#x4E2A;&#x51FD;&#x6570;&#xFF0C;&#x5176;&#x529F;&#x80FD;&#x662F;&#x5411;&#x9A71;&#x52A8;&#x82AF;&#x7247;&#x53D1;&#x9001;&#x4E00;&#x4E2A;&#x5B57;&#x8282;&#x7684;&#x6570;&#x636E;&#xFF0C;&#x5E76;&#x544A;&#x77E5;&#x8BE5;&#x9A71;&#x52A8;&#x8FD9;&#x4E2A;&#x5B57;&#x8282;&#x662F;<strong>&#x6570;&#x636E;</strong>&#x8FD8;&#x662F;<strong>&#x547D;&#x4EE4;</strong>&#xFF0C;&#x5177;&#x4F53;&#x6D41;&#x7A0B;&#x4E3A;&#xFF1A;</p>
<ul>
<li>&#x7531;&#x8F93;&#x5165;&#x53C2;&#x6570;cmd&#x5224;&#x65AD;&#x6539;&#x6307;&#x4EE4;&#x662F;&#x5426;&#x662F;&#x6570;&#x636E;&#xFF0C;&#x5982;&#x679C;&#x662F;&#xFF0C;&#x5219;&#x5C06;DC&#x5F15;&#x811A;&#x7F6E;&#x4E3A;&#x9AD8;&#x7535;&#x5E73;</li>
<li>&#x7247;&#x9009;&#x5F15;&#x811A;&#x62C9;&#x4F4E;&#xFF0C;&#x9009;&#x4E2D;OLED&#x9A71;&#x52A8;</li>
<li>&#x5728;for&#x5FAA;&#x73AF;&#x4E2D;&#x5F00;&#x59CB;<strong>&#x9010;&#x4E2A;bit</strong>&#x4F20;&#x8F93;&#x6570;&#x636E;</li>
<li>&#x4F20;&#x8F93;&#x5B8C;&#x6210;&#x540E;CS&#x548C;DC&#x5F15;&#x811A;&#x7F6E;&#x9AD8;&#x7535;&#x5E73;&#xFF0C;&#x56DE;&#x5230;&#x521D;&#x59CB;&#x72B6;&#x6001;</li>
</ul>
<p>&#x8FD9;&#x91CC;&#x7684;for&#x5FAA;&#x73AF;&#x4EE3;&#x7801;&#x4E3A;&#x6A21;&#x62DF;&#x7684;SPI&#x65F6;&#x5E8F;&#x4EE3;&#x7801;&#xFF0C;&#x65F6;&#x949F;&#x7EBF;&#x548C;&#x6570;&#x636E;&#x7EBF;&#x90FD;&#x662F;<strong>&#x624B;&#x52A8;</strong>&#x63A7;&#x5236;&#xFF0C;&#x5176;&#x903B;&#x8F91;&#x4E3A;&#xFF1A;</p>
<ul>
<li>&#x65F6;&#x949F;&#x7EBF;&#x62C9;&#x4F4E;&#xFF0C;&#x7B49;&#x5F85;&#x6570;&#x636E;&#x7EBF;&#x8F6C;&#x6362;</li>
<li>&#x5224;&#x65AD;<strong>&#x5F85;&#x4F20;&#x8F93;&#x6570;&#x636E;&#x7684;&#x6700;&#x9AD8;&#x4F4D;</strong>&#xFF0C;&#x4F9D;&#x636E;&#x8BE5;&#x6700;&#x9AD8;&#x4F4D;&#x8BBE;&#x7F6E;&#x6570;&#x636E;&#x7EBF;&#x7684;&#x7535;&#x5E73;</li>
<li>&#x65F6;&#x949F;&#x7EBF;&#x62C9;&#x9AD8;&#xFF0C;<strong>&#x901A;&#x8FC7;&#x4E0A;&#x5347;&#x6CBF;&#x53D1;&#x9001;&#x6570;&#x636E;</strong></li>
<li>&#x5C06;&#x5F85;&#x53D1;&#x9001;&#x7684;<strong>&#x6570;&#x636E;&#x79FB;&#x4F4D;</strong>&#xFF0C;&#x8FDB;&#x5165;&#x4E0B;&#x4E00;&#x6B21;&#x5FAA;&#x73AF;&#x65F6;&#x53D1;&#x9001;&#x4E0B;&#x4E00;&#x4E2A;bit&#x4F4D;</li>
</ul>
<p>&#x5728;&#x5269;&#x4F59;IO&#x53E3;&#x6CA1;&#x6709;SPI&#x529F;&#x80FD;&#xFF0C;&#x6216;&#x8005;&#x786C;&#x4EF6;SPI&#x529F;&#x80FD;&#x4E0D;&#x65B9;&#x4FBF;&#x4F7F;&#x7528;&#x65F6;&#xFF0C;&#x6211;&#x4EEC;&#x53C2;&#x8003;&#x8FD9;&#x6837;&#x7684;&#x65B9;&#x5F0F;&#x7F16;&#x5199;&#x6A21;&#x62DF;&#x7684;&#x901A;&#x4FE1;&#x65F6;&#x5E8F;</p>
<h3 id="&#x65F6;&#x5E8F;&#x7A0B;&#x5E8F;&#x66F4;&#x6539;">&#x65F6;&#x5E8F;&#x7A0B;&#x5E8F;&#x66F4;&#x6539;</h3>
<p>&#x672C;&#x6B21;&#x79FB;&#x690D;&#x6211;&#x4EEC;&#x4F7F;&#x7528;<strong>&#x786C;&#x4EF6;SPI&#x534F;&#x8BAE;&#x901A;&#x4FE1;</strong>&#xFF0C;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x8C03;&#x7528;&#x76F8;&#x5E94;&#x7684;SPI&#x53D1;&#x9001;&#x51FD;&#x6570;</p>
<p>&#x5728;<code>oled.c</code>&#x7684;&#x6587;&#x4EF6;&#x5F00;&#x5934;&#x5916;&#x90E8;&#x5F15;&#x7528;&#x76F8;&#x5E94;&#x53E5;&#x67C4;&#xFF0C;&#x89C4;&#x5B9A;&#x76F8;&#x5E94;&#x5B8F;&#x5B9A;&#x4E49;&#x65B9;&#x4FBF;&#x540E;&#x7EED;&#x79FB;&#x690D;&#xFF1A;</p>
<pre><code class="lang-c"><span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-string">&quot;oledfont.h&quot;</span></span>

<span class="hljs-keyword">extern</span> SPI_HandleTypeDef hspi2;
<span class="hljs-meta">#<span class="hljs-meta-keyword">define</span> OLED_SPI hspi2</span>

u8 OLED_GRAM[<span class="hljs-number">144</span>][<span class="hljs-number">8</span>];
</code></pre>
<p>&#x5C06;&#x53D1;&#x9001;&#x4E00;&#x4E2A;byte&#x7684;&#x51FD;&#x6570;&#x6539;&#x4E3A;</p>
<pre><code class="lang-c"><span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">OLED_WR_Byte</span><span class="hljs-params">(u8 dat, u8 cmd)</span>
</span>{
    <span class="hljs-keyword">if</span> (cmd)
        OLED_DC_Set();
    <span class="hljs-keyword">else</span>
        OLED_DC_Clr();
    OLED_CS_Clr();
    HAL_SPI_Transmit(&amp;hspi2, &amp;dat, <span class="hljs-number">1</span>, <span class="hljs-number">0xFF</span>);
    OLED_CS_Set();
    OLED_DC_Set();
}
</code></pre>
<h2 id="&#x9A71;&#x52A8;&#x4EE3;&#x7801;&#x5BF9;&#x63A5;">&#x9A71;&#x52A8;&#x4EE3;&#x7801;&#x5BF9;&#x63A5;</h2>
<p>&#x53C2;&#x8003;&#x5356;&#x5BB6;&#x6240;&#x7ED9;&#x5386;&#x7A0B;&#x7684;&#x7A0B;&#x5E8F;&#x4EE3;&#x7801;&#xFF0C;&#x5728;<code>main.c</code>&#x6DFB;&#x52A0;&#x5982;&#x4E0B;&#x4EE3;&#x7801;&#xFF1A;</p>
<h3 id="&#x76F8;&#x5E94;&#x5934;&#x6587;&#x4EF6;&#x7684;&#x5F15;&#x7528;&#xFF1A;">&#x76F8;&#x5E94;&#x5934;&#x6587;&#x4EF6;&#x7684;&#x5F15;&#x7528;&#xFF1A;</h3>
<pre><code>/* USER CODE BEGIN Includes */
#include &quot;oled.h&quot;
#include &quot;bmp.h&quot;
/* USER CODE END Includes */
</code></pre><h3 id="&#x521D;&#x59CB;&#x5316;&#x4EE3;&#x7801;&#x548C;&#x53D8;&#x91CF;&#x5B9A;&#x4E49;&#xFF1A;">&#x521D;&#x59CB;&#x5316;&#x4EE3;&#x7801;&#x548C;&#x53D8;&#x91CF;&#x5B9A;&#x4E49;&#xFF1A;</h3>
<pre><code class="lang-c">  <span class="hljs-comment">/* USER CODE BEGIN 2 */</span>
  u8 t = <span class="hljs-string">&apos; &apos;</span>;

  OLED_Init();
  OLED_ColorTurn(<span class="hljs-number">0</span>);   <span class="hljs-comment">//0&#x6B63;&#x5E38;&#x663E;&#x793A;&#xFF0C;1 &#x53CD;&#x8272;&#x663E;&#x793A;</span>
  OLED_DisplayTurn(<span class="hljs-number">0</span>); <span class="hljs-comment">//0&#x6B63;&#x5E38;&#x663E;&#x793A; 1 &#x5C4F;&#x5E55;&#x7FFB;&#x8F6C;&#x663E;&#x793A;</span>
  <span class="hljs-comment">/* USER CODE END 2 */</span>
</code></pre>
<h3 id="&#x6D4B;&#x8BD5;&#x4EE3;&#x7801;">&#x6D4B;&#x8BD5;&#x4EE3;&#x7801;</h3>
<pre><code class="lang-c">  <span class="hljs-keyword">while</span> (<span class="hljs-number">1</span>)
  {
        OLED_ShowPicture(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">128</span>, <span class="hljs-number">64</span>, BMP1, <span class="hljs-number">1</span>);
        OLED_Refresh();
        HAL_Delay(<span class="hljs-number">500</span>);
        OLED_Clear();
        OLED_ShowChinese(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">16</span>, <span class="hljs-number">1</span>);    <span class="hljs-comment">//&#x4E2D;</span>
        OLED_ShowChinese(<span class="hljs-number">18</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">16</span>, <span class="hljs-number">1</span>);    <span class="hljs-comment">//&#x666F;</span>
        OLED_ShowChinese(<span class="hljs-number">36</span>, <span class="hljs-number">0</span>, <span class="hljs-number">2</span>, <span class="hljs-number">16</span>, <span class="hljs-number">1</span>);    <span class="hljs-comment">//&#x56ED;</span>
        OLED_ShowString(<span class="hljs-number">8</span>, <span class="hljs-number">16</span>, <span class="hljs-string">&quot;ZHONGJINGYUAN&quot;</span>, <span class="hljs-number">16</span>, <span class="hljs-number">1</span>);
        OLED_ShowString(<span class="hljs-number">20</span>, <span class="hljs-number">32</span>, <span class="hljs-string">&quot;2014/05/01&quot;</span>, <span class="hljs-number">16</span>, <span class="hljs-number">1</span>);
        OLED_ShowString(<span class="hljs-number">0</span>, <span class="hljs-number">48</span>, <span class="hljs-string">&quot;ASCII:&quot;</span>, <span class="hljs-number">16</span>, <span class="hljs-number">1</span>);
        OLED_ShowString(<span class="hljs-number">63</span>, <span class="hljs-number">48</span>, <span class="hljs-string">&quot;CODE:&quot;</span>, <span class="hljs-number">16</span>, <span class="hljs-number">1</span>);
        OLED_ShowChar(<span class="hljs-number">48</span>, <span class="hljs-number">48</span>, t, <span class="hljs-number">16</span>, <span class="hljs-number">1</span>); <span class="hljs-comment">//&#x663E;&#x793A;ASCII&#x5B57;&#x7B26;</span>
        t++;
        <span class="hljs-keyword">if</span> (t &gt; <span class="hljs-string">&apos;~&apos;</span>)
            t = <span class="hljs-string">&apos; &apos;</span>;
        OLED_ShowNum(<span class="hljs-number">103</span>, <span class="hljs-number">48</span>, t, <span class="hljs-number">3</span>, <span class="hljs-number">16</span>, <span class="hljs-number">1</span>);
        OLED_Refresh();
        HAL_Delay(<span class="hljs-number">500</span>);
        OLED_Clear();
        OLED_ShowChinese(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">16</span>, <span class="hljs-number">1</span>);    <span class="hljs-comment">//16*16 &#x4E2D;</span>
        OLED_ShowChinese(<span class="hljs-number">16</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">24</span>, <span class="hljs-number">1</span>);    <span class="hljs-comment">//24*24 &#x4E2D;</span>
        OLED_ShowChinese(<span class="hljs-number">24</span>, <span class="hljs-number">20</span>, <span class="hljs-number">0</span>, <span class="hljs-number">32</span>, <span class="hljs-number">1</span>); <span class="hljs-comment">//32*32 &#x4E2D;</span>
        OLED_ShowChinese(<span class="hljs-number">64</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">64</span>, <span class="hljs-number">1</span>);    <span class="hljs-comment">//64*64 &#x4E2D;</span>
        OLED_Refresh();
        HAL_Delay(<span class="hljs-number">500</span>);
        OLED_Clear();
        OLED_ShowString(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-string">&quot;ABC&quot;</span>, <span class="hljs-number">8</span>, <span class="hljs-number">1</span>);      <span class="hljs-comment">//6*8 &#x201C;ABC&#x201D;</span>
        OLED_ShowString(<span class="hljs-number">0</span>, <span class="hljs-number">8</span>, <span class="hljs-string">&quot;ABC&quot;</span>, <span class="hljs-number">12</span>, <span class="hljs-number">1</span>);  <span class="hljs-comment">//6*12 &#x201C;ABC&#x201D;</span>
        OLED_ShowString(<span class="hljs-number">0</span>, <span class="hljs-number">20</span>, <span class="hljs-string">&quot;ABC&quot;</span>, <span class="hljs-number">16</span>, <span class="hljs-number">1</span>); <span class="hljs-comment">//8*16 &#x201C;ABC&#x201D;</span>
        OLED_ShowString(<span class="hljs-number">0</span>, <span class="hljs-number">36</span>, <span class="hljs-string">&quot;ABC&quot;</span>, <span class="hljs-number">24</span>, <span class="hljs-number">1</span>); <span class="hljs-comment">//12*24 &#x201C;ABC&#x201D;</span>
        OLED_Refresh();
        HAL_Delay(<span class="hljs-number">500</span>);
        OLED_ScrollDisplay(<span class="hljs-number">11</span>, <span class="hljs-number">4</span>, <span class="hljs-number">1</span>);
    <span class="hljs-comment">/* USER CODE END WHILE */</span>
</code></pre>
<p>&#x4E4B;&#x540E;&#x5C31;&#x53EF;&#x4EE5;&#x7F16;&#x8BD1;&#x4EE3;&#x7801;&#x4E0B;&#x8F7D;&#x6D4B;&#x8BD5;&#x6548;&#x679C;&#x4E86;</p>
<p><img src="assets/OLED&#x6548;&#x679C;&#x6F14;&#x793A;.gif" alt="OLED&#x6548;&#x679C;&#x6F14;&#x793A;"></p>
<h2 id="&#x4E3B;&#x8981;api">&#x4E3B;&#x8981;API</h2>
<table>
<thead>
<tr>
<th>&#x51FD;&#x6570;</th>
<th>&#x529F;&#x80FD;</th>
<th>&#x53C2;&#x6570;</th>
</tr>
</thead>
<tbody>
<tr>
<td>OLED_Clear</td>
<td>&#x6E05;&#x5C4F;</td>
<td>&#x65E0;</td>
</tr>
<tr>
<td>OLED_Refresh</td>
<td>&#x5237;&#x5C4F;</td>
<td>&#x65E0;</td>
</tr>
<tr>
<td>OLED_ShowPicture</td>
<td>&#x663E;&#x793A;&#x56FE;&#x7247;</td>
<td>x&#xFF0C;y&#xFF0C;&#x5BBD;&#xFF0C;&#x9AD8;&#xFF0C;&#x9ED1;/&#x767D;</td>
</tr>
<tr>
<td>OLED_ShowChinese</td>
<td>&#x663E;&#x793A;&#x6C49;&#x5B57;</td>
<td>x&#xFF0C;y&#xFF0C;&#x7F16;&#x53F7;&#xFF0C;&#x5927;&#x5C0F;&#xFF0C;&#x9ED1;/&#x767D;</td>
</tr>
<tr>
<td>OLED_ShowString</td>
<td>&#x663E;&#x793A;&#x5B57;&#x7B26;&#x4E32;</td>
<td>x&#xFF0C;y&#xFF0C;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x5927;&#x5C0F;&#xFF0C;&#x9ED1;/&#x767D;</td>
</tr>
<tr>
<td>OLED_DrawLine</td>
<td>&#x753B;&#x7EBF;</td>
<td>x1&#xFF0C;y1&#xFF0C;x2&#xFF0C;y2&#xFF0C;&#x9ED1;/&#x767D;</td>
</tr>
<tr>
<td>OLED_DrawCircle</td>
<td>&#x753B;&#x5706;</td>
<td>&#x5706;&#x5FC3;x&#xFF0C;&#x5706;&#x5FC3;y&#xFF0C;&#x534A;&#x5F84;</td>
</tr>
</tbody>
</table>
<p>&#x9ED8;&#x8BA4;&#x63D0;&#x4F9B;&#x7684;&#x9A71;&#x52A8;&#x4EE3;&#x7801;&#x663E;&#x793A;&#x6C49;&#x5B57;&#x65F6;&#x9700;&#x8981;<strong>&#x81EA;&#x884C;&#x53D6;&#x6A21;</strong>&#xFF0C;&#x7ED8;&#x5236;&#x56FE;&#x5F62;&#x7684;&#x51FD;&#x6570;&#x4E5F;&#x4E0D;&#x591F;&#x4E30;&#x5BCC;&#xFF0C;&#x540E;&#x9762;&#x4F1A;&#x4ECB;&#x7ECD;&#x7ED3;&#x5408;&#x4E86;<a href="https://www.bilibili.com/video/BV1EC4y1872W?from=search&amp;seid=18236455494321671647&amp;spm_id_from=333.337.0.0" target="_blank">B&#x7AD9;up&#x5F00;&#x6E90;&#x4EE3;&#x7801;</a>&#x7684;&#x5B57;&#x5E93;&#x56FE;&#x5F62;&#x5E93;</p>
<h1 id="one-more-thing">One more thing</h1>
<h2 id="&#x5B57;&#x5E93;&#x56FE;&#x5F62;&#x5E93;&#x7684;&#x4F7F;&#x7528;">&#x5B57;&#x5E93;&#x56FE;&#x5F62;&#x5E93;&#x7684;&#x4F7F;&#x7528;</h2>
<h2 id="api&#x4ECB;&#x7ECD;">API&#x4ECB;&#x7ECD;</h2>
 
          </section>
          
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>
 
        </div>
      </div>
      
    </div>

     
    <a
      href="CubeMX配置及主要函数.html"
      class="
        navigation navigation-prev
        
      "
      aria-label="Previous page: CubeMX配置及主要参数"
    >
      <i class="fa fa-angle-left"></i>
    </a>
     
    <a
      href="LVGL移植显示.html"
      class="
        navigation navigation-next
        
      "
      aria-label="Next page: LVGL移植显示"
    >
      <i class="fa fa-angle-right"></i>
    </a>
      
  </div>
  <script>
    function showModal() {
      document.getElementsByClassName("mask")[0].style.display = "block";
      document.getElementsByClassName("donate-modal")[0].style.display =
        "block";
    }
    // 切换赞赏码
    function showDonateImg(num) {
      let alipay = "";
      let wxpay = ""
      if(num){
        wxpay = "hidden"
      }else{
        alipay = "hidden"
      }
      document.getElementById("wxpay-code").hidden = wxpay;
      document.getElementById("alipay-code").hidden = alipay;
      document.getElementsByName("pay-way")[num].checked = "checked";
    }

    // 关闭赞赏框
    function closeDonateModal() {
      document.getElementsByClassName("mask")[0].style.display = "none";
      document.getElementsByClassName("donate-modal")[0].style.display = "none";
    }

    var gitbook = gitbook || [];
    gitbook.push(function () {
      gitbook.page.hasChanged({"page":{"title":"OLED驱动移植","level":"1.7.2","depth":2,"next":{"title":"LVGL移植显示","level":"1.7.3","depth":2,"path":"SPI协议/LVGL移植显示.md","ref":"./SPI协议/LVGL移植显示.md","articles":[]},"previous":{"title":"CubeMX配置及主要参数","level":"1.7.1","depth":2,"path":"SPI协议/CubeMX配置及主要函数.md","ref":"./SPI协议/CubeMX配置及主要函数.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-lunr","-sharing","-search","-favicon","-code","expandable-chapters","theme-lou","back-to-top-button","search-pro","livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"search-pro":{},"code":{"copyButtons":true},"theme-lou":{"hide-elements":[".summary .gitbook-link"],"color":"#8abcd1","copyright":{"author":"Atonidas"},"forbidCopy":false,"logo":"assets/logo.png","search-placeholder":"查找关键内容","copyrightLogo":"assets/copyright.png","favicon":"assets/favicon.ico","autoNumber":3},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"back-to-top-button":{},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"expandable-chapters":{}},"theme":"default","author":"Atonidas","lang":"zh-cn","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{"themeLou":{"nav":[{"target":"_blank","url":"https://Gitee.com/atonidas","name":"Gitee"}]}},"title":"STM32HAL系列教程","gitbook":"*","description":"Gitbook电子书示例项目"},"file":{"path":"SPI协议/OLED驱动移植.md","mtime":"2023-04-04T06:18:13.026Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2023-09-13T00:50:24.020Z"},"basePath":"..","book":{"language":""}});
    });
  </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-theme-lou/lou.js"></script>
        
    

    </body>
</html>

